<%--
  Created by IntelliJ IDEA.
  User: 几何
  Date: 2022/4/19
  Time: 20:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<head>
    <title>Title</title>
</head>
<script type="text/javascript">
    function a(){
        var userName = $("#userName").val();
        $.ajax({
            url:"http://localhost:8081/ajaxuser/alluser",
            data:{"userName":userName},
            success:function (data){
        }
        })
    }
    function as(){
        alert("a");
    }

</script>
<body>
<h1>ajax</h1>
username:<input type="text" id="userName"><button onclick="a()">异步</button>

<input type="button" onclick="as()" value="测试">
</body>
</html>
